﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNet.Random.Date
{
    /// <summary>
    /// 天随机类，继承于抽象类IntRandService
    /// </summary>
    public class DayRandService : DotNet.Random.Int.IntRandService
    {
        /// <summary>
        /// Rands this instance.
        /// </summary>
        /// <returns></returns>
        public override int Rand()
        {
            var res = this.Build.Rand(this.Serial, 1);
            return res.FirstOrDefault();
        }
    }

    /// <summary>
    /// 28天随机类，继承于DayRandService
    /// </summary>
    class DayTwentyEightRandService : DayRandService
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DayTwentyEightRandService" /> class.
        /// </summary>
        public DayTwentyEightRandService()
        {
            for (int i = 1; i < 29; i++)
            {
                this.Serial.Add(i);
            }
        }
    }

    /// <summary>
    /// 29天随机类，继承于DayTwentyEightRandService
    /// </summary>
    class DayTwentyNineRandService : DayTwentyEightRandService
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DayTwentyNineRandService" /> class.
        /// </summary>
        public DayTwentyNineRandService()
        {
            this.Serial.Add(29);
        }

    }

    /// <summary>
    /// 30天随机类，继承于DayTwentyNineRandService
    /// </summary>
    class DayThirtyRandService : DayTwentyNineRandService
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DayThirtyRandService" /> class.
        /// </summary>
        public DayThirtyRandService()
        {
            this.Serial.Add(30);
        }
    }

    /// <summary>
    /// 31天随机类，继承于DayThirtyRandService
    /// </summary>
    class DayThirtyOneRandService : DayThirtyRandService
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DayThirtyOneRandService" /> class.
        /// </summary>
        public DayThirtyOneRandService()
        {
            this.Serial.Add(31);
        }
    }
}
